package com.component1;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * @author fanxiao  2022/12/20
 * @since 1.0.0
 */
public class TestPostProcessor implements BeanPostProcessor {

	@Autowired
	@Lazy
	private Eoo2 eoo2;


	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
		if (beanName.equals("eoo2")) {
      		System.out.println("eoo2.test()");
			eoo2.test();
		}

		return bean;
	}
}